Skip to content

agent: @U0AJM7X8FBR @U0AJM7X8FBR become an expert at this repo https://github.c#92

Open
recoup-coding-agent wants to merge 1 commit intomainfrom
agent/-u0ajm7x8fbr--u0ajm7x8fbr-beco-1773529339998
Open

agent: @U0AJM7X8FBR @U0AJM7X8FBR become an expert at this repo https://github.c#92
recoup-coding-agent wants to merge 1 commit intomainfrom
agent/-u0ajm7x8fbr--u0ajm7x8fbr-beco-1773529339998

Conversation

@recoup-coding-agent
Copy link
Copy Markdown
Collaborator

@recoup-coding-agent recoup-coding-agent commented Mar 14, 2026

Automated PR from coding agent.

Summary by CodeRabbit

  • New Features

    • Added support for custom audio buffers in video generation workflows.
  • Bug Fixes

    • Improved error handling and validation for authentication tokens.
    • Enhanced graceful fallbacks for missing configuration files.
    • Reduced coding task timeout duration for better performance.
  • Documentation

    • Expanded JSDoc comments throughout the codebase for improved code clarity.
  • Refactor

    • Standardized code formatting and arrow function syntax for consistency.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 14, 2026

📝 Walkthrough

Walkthrough

Comprehensive codebase refactoring across 65+ files introducing JSDoc parameter annotations, reformatting function signatures from multi-line to single-line declarations, normalizing arrow function parameter syntax, and adding trailing commas. Notable functional changes include expanding generateAudioVideo with a songBuffer parameter, reducing codingAgentTask duration from 30 to 15 minutes, and adding null-safety guards in loadTemplate.

Changes

Cohort / File(s) Summary
Content Pipeline Documentation & Formatting
src/content/analyzeClips.ts, src/content/defaultPipelineConfig.ts, src/content/fetchArtistContext.ts, src/content/fetchAudienceContext.ts, src/content/fetchGithubFile.ts, src/content/generateCaption.ts, src/content/generateContentImage.ts, src/content/generateContentVideo.ts, src/content/listArtistSongs.ts, src/content/loadTemplate.ts, src/content/renderFinalVideo.ts, src/content/selectAudioClip.ts, src/content/transcribeSong.ts, src/content/upscaleImage.ts, src/content/upscaleVideo.ts
Expanded JSDoc parameter documentation, collapsed multi-line signatures to single-line format, reformatted FFmpeg argument arrays. loadTemplate adds null-safety guards with fallback defaults for missing JSON files.
generateAudioVideo Signature Expansion
src/content/generateAudioVideo.ts
Added songBuffer: Buffer parameter to function input object; updated JSDoc to document all input fields including new songBuffer, and reformatted internal function calls to single-line format.
Content Pipeline Integration & Testing
src/content/testPipeline.ts
Added setupFal() helper to validate FAL_KEY and configure credentials; introduced loadState()/saveState() with Promise types; expanded all test functions with multiline formatting, guard checks for missing state fields, and verbose error handling.
Artist & Social Module Documentation
src/artists/getBatchArtistSocials.ts, src/artists/isScrapableSocial.ts, src/socials/filterScrapableSocials.ts, src/socials/scrapeAndPollSocials.ts
Added JSDoc @param entries, normalized arrow function syntax (removed parentheses from single-parameter callbacks), reformatted type annotations to single-line format.
Chat & Polling Utilities
src/chats/getTaskRoomId.ts, src/polling/pollScraperResults.ts, src/consts.ts
Collapsed multi-line function signatures to single-line; added JSDoc parameter annotations. consts.ts fixed line-ending formatting for OPENCLAW_DEFAULT_MODEL export.
GitHub Repository Management
src/github/createGithubRepo.ts, src/github/createOrgGithubRepo.ts, src/github/getExistingGithubRepo.ts
Added trailing commas to function parameters; refactored fetch calls from multi-line to single-line argument passing. getExistingGithubRepo adds explicit GITHUB_TOKEN validation with error logging.
Recoup API Module Signatures
src/recoup/createAccountSandbox.ts, src/recoup/createChat.ts, src/recoup/fetchTask.ts, src/recoup/generateChat.ts, src/recoup/getAccount.ts, src/recoup/getAccountOrgs.ts, src/recoup/getAccountSandboxes.ts, src/recoup/getArtistSocials.ts, src/recoup/getProArtists.ts, src/recoup/getScraperResults.ts, src/recoup/scrapeSocial.ts
Systematically added trailing commas to function parameter lists; collapsed multi-line signatures to single-line format; expanded JSDoc with parameter documentation. getAccountOrgs consolidates URL construction to single-line.
Recoup Snapshot & Account Management
src/recoup/updateAccountSnapshot.ts
Added trailing comma to parameter list; no functional changes.
Sandbox Initialization & Repository Management
src/sandboxes/cloneMonorepoViaAgent.ts, src/sandboxes/configureGitAuth.ts, src/sandboxes/ensureGithubRepo.ts, src/sandboxes/ensureOrgRepos.ts, src/sandboxes/ensureSetupSandbox.ts, src/sandboxes/getOrCreateSandbox.ts, src/sandboxes/getSandboxEnv.ts, src/sandboxes/getVercelSandboxCredentials.ts, src/sandboxes/installSkill.ts, src/sandboxes/logStep.ts, src/sandboxes/notifyCodingAgentCallback.ts, src/sandboxes/onboardOpenClaw.ts, src/sandboxes/parsePRUrls.ts, src/sandboxes/pushSandboxToGithub.ts, src/sandboxes/runGitCommand.ts, src/sandboxes/runOpenClawAgent.ts, src/sandboxes/runSetupArtistSkill.ts, src/sandboxes/runSetupSandboxSkill.ts, src/sandboxes/setupOpenClaw.ts, src/sandboxes/snapshotAndPersist.ts, src/sandboxes/writeReadme.ts
Collapsed multi-line function signatures to single-line declarations; added trailing commas to parameter lists; added JSDoc annotations. ensureOrgRepos adds early return and logging for missing GITHUB_TOKEN; pushOrgRepos adds GITHUB_TOKEN validation.
Sandbox Git Operations
src/sandboxes/git/addOrgSubmodules.ts, src/sandboxes/git/pushOrgRepos.ts
Normalized arrow function parameter syntax (removed unnecessary parentheses); pushOrgRepos adds early GITHUB_TOKEN check with user-facing log message.
Task Implementations
src/tasks/codingAgentTask.ts, src/tasks/createContentTask.ts, src/tasks/customerPromptTask.ts, src/tasks/proArtistSocialProfilesScrape.ts, src/tasks/runSandboxCommandTask.ts, src/tasks/sendPulsesTask.ts, src/tasks/setupSandboxTask.ts, src/tasks/updatePRTask.ts
Normalized arrow function parameter syntax; collapsed multi-line argument lists. codingAgentTask reduces maxDuration from 30 to 15 minutes; other files focus on formatting and single-parameter callback syntax simplification.
Pulse & Sandbox Testing
src/pulse/executePulseInSandbox.ts, src/pulse/__tests__/executePulseInSandbox.test.ts
Added JSDoc parameter documentation for nested objects; reformatted test assertion to single-line format.
Sandbox Test Utilities
src/sandboxes/__tests__/addOrgSubmodules.test.ts, src/sandboxes/__tests__/configureGitAuth.test.ts, src/sandboxes/__tests__/copyOpenClawToRepo.test.ts, src/sandboxes/__tests__/ensureOrgRepos.test.ts, src/sandboxes/__tests__/getGitHubAuthPrefix.test.ts, src/sandboxes/__tests__/getOrCreateSandbox.test.ts, src/sandboxes/__tests__/getSandboxHomeDir.test.ts, src/sandboxes/__tests__/notifyCodingAgentCallback.test.ts, src/sandboxes/__tests__/pushOrgRepos.test.ts, src/sandboxes/__tests__/runClaudeCodeAgent.test.ts, src/sandboxes/__tests__/runOpenClawAgent.test.ts, src/sandboxes/__tests__/setupOpenClaw.test.ts, src/sandboxes/__tests__/snapshotAndPersist.test.ts, src/sandboxes/__tests__/stripGitmodulesTokens.test.ts, src/sandboxes/__tests__/syncOrgRepos.test.ts
Collapsed multi-line predicates and assertions to single-line arrow functions; added JSDoc documentation blocks for test helper functions; normalized predicate filtering in mocks.
GitHub & Recoup Test Files
src/github/__tests__/createOrgGithubRepo.test.ts, src/recoup/__tests__/getAccountOrgs.test.ts
Reformatted assertion values from multi-line to single-line string literals; no behavioral changes.
Task Test Files
src/tasks/__tests__/codingAgentTask.test.ts, src/tasks/__tests__/sendPulsesTask.test.ts, src/tasks/__tests__/setupSandboxTask.test.ts, src/tasks/__tests__/updatePRTask.test.ts
Reformatted mock object properties to multi-line layout; collapsed arrow function parameters; adjusted assertion formatting.
Schema Definitions
src/schemas/contentCreationSchema.ts, src/schemas/sandboxSchema.ts, src/schemas/__tests__/contentCreationSchema.test.ts
Reformatted type aliases and infer expressions to single-line format; removed trailing blank lines; no semantic changes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • #41 — Modifies src/tasks/codingAgentTask.ts which this PR also updates with duration change and arrow function syntax normalization.
  • #43 — Touches the same content pipeline files (generateAudioVideo, analyzeClips, renderFinalVideo, defaultPipelineConfig) that receive JSDoc and formatting updates in this PR.
  • #38 — Modifies sandbox modules (ensureOrgRepos.ts, pushOrgRepos.ts) that this PR also refactors with GITHUB_TOKEN validation and signature formatting.

Poem

🐰 Formatting hops and docs take flight,
Parameter names shining bright,
Trailing commas find their place,
Functions sprint at quickened pace,
Sandbox guards now stand up tall—
Cleanup magic blessed us all! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The pull request title appears to be truncated, incomplete, and unrelated to the actual changeset. The changeset contains extensive formatting improvements, documentation enhancements, and minor logic adjustments across numerous files, but the title references usernames and an incomplete GitHub URL without describing any meaningful change. Replace the title with a descriptive summary of the main changes, such as 'chore: improve code formatting, documentation, and minor logic enhancements across codebase' or a more specific focus area if applicable.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch agent/-u0ajm7x8fbr--u0ajm7x8fbr-beco-1773529339998
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 10

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (6)
src/polling/pollScraperResults.ts (1)

30-33: ⚠️ Potential issue | 🔴 Critical

Add retry limits to prevent infinite polling loop.

When getScraperResults returns null, the function logs a warning but keeps the run in pendingRuns. If polling consistently fails for a run, this creates an infinite loop where the function polls every 10 seconds indefinitely with no escape condition.

🔒 Proposed fix to add retry tracking and limits
 export async function pollScraperResults(runs: ScrapeRun[]): Promise<PollResult[]> {
   const results: PollResult[] = [];
   const pendingRuns = new Map<string, ScrapeRun>(runs.map(run => [run.runId, run]));
+  const retryCount = new Map<string, number>();
+  const MAX_RETRIES = 30; // 30 retries * 10 seconds = 5 minutes max
 
   while (pendingRuns.size > 0) {
     // Poll all pending runs in parallel
     const pollPromises = Array.from(pendingRuns.values()).map(async run => {
       const result = await getScraperResults(run.runId);
 
       if (!result) {
+        const count = (retryCount.get(run.runId) || 0) + 1;
+        retryCount.set(run.runId, count);
+        
+        if (count >= MAX_RETRIES) {
+          logger.error("Max retries exceeded for scraper run", { 
+            runId: run.runId, 
+            retries: count 
+          });
+          return {
+            run,
+            pollResult: {
+              runId: run.runId,
+              datasetId: run.datasetId,
+              status: "FAILED",
+            },
+          };
+        }
+        
         logger.warn("Failed to get scraper result", { runId: run.runId });
         return null;
       }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/polling/pollScraperResults.ts` around lines 30 - 33, The function
pollScraperResults currently leaves runs in pendingRuns when getScraperResults
returns null, causing infinite polling; add retry tracking and a max retry limit
to break out: introduce a retry counter (e.g., map pendingRetries keyed by
run.runId) incremented each time getScraperResults returns null inside
pollScraperResults, stop polling and remove the run from pendingRuns (or mark it
failed) once the counter exceeds a configurable MAX_RETRIES, and reset the
counter when a successful result is received; update any related logging
(logger.warn / logger.error) to include runId and current retry count so
failures are visible.
src/content/listArtistSongs.ts (2)

52-56: ⚠️ Potential issue | 🟡 Minor

Delimiter __ in URL or path will break parsing.

The split("__") approach fails if the GitHub URL or file path contains __. For example, a repo named foo__bar would be incorrectly parsed.

Consider using a more robust delimiter (e.g., a non-printable character or JSON encoding) or a fixed-position split:

♻️ Proposed fix using indexOf for first delimiter only
 export function parseSongPath(encodedPath: string): {
   repoUrl: string | null;
   filePath: string;
 } {
   if (encodedPath.startsWith("__ORG_REPO__")) {
-    const parts = encodedPath.replace("__ORG_REPO__", "").split("__");
-    return { repoUrl: parts[0], filePath: parts.slice(1).join("__") };
+    const remainder = encodedPath.slice("__ORG_REPO__".length);
+    const delimiterIndex = remainder.indexOf("__");
+    if (delimiterIndex === -1) {
+      return { repoUrl: null, filePath: encodedPath };
+    }
+    return {
+      repoUrl: remainder.slice(0, delimiterIndex),
+      filePath: remainder.slice(delimiterIndex + 2),
+    };
   }
   return { repoUrl: null, filePath: encodedPath };
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/content/listArtistSongs.ts` around lines 52 - 56, The current parsing
uses encodedPath.replace("__ORG_REPO__", "").split("__") which breaks when the
repo URL or file path contains "__"; change to remove the "__ORG_REPO__" prefix
into a variable (e.g., remaining = encodedPath.slice("__ORG_REPO__".length)),
then locate the first separator with remaining.indexOf("__") and split into
repoUrl = remaining.slice(0, idx) and filePath = remaining.slice(idx + 2)
(handling idx === -1 by setting filePath to "" or null); update the logic around
encodedPath, "__ORG_REPO__", repoUrl and filePath to preserve any "__"
characters in the repo or file path.

74-85: ⚠️ Potential issue | 🟡 Minor

Hardcoded main branch fails silently for repos using master or other defaults.

The GitHub API call assumes the default branch is main. If a repo uses master or another default branch, the request returns 404 and silently returns an empty array at line 85, causing false negatives.

Fetch the repository's default branch first using GET /repos/{owner}/{repo} (which includes the default_branch field in the response), then use it in the tree API call.

Current code
  const response = await fetch(
    `https://api.github.com/repos/${owner}/${repo}/git/trees/main?recursive=1`,
    {
      headers: {
        Authorization: `Bearer ${token}`,
        Accept: "application/vnd.github.v3+json",
        "User-Agent": "Recoup-Tasks",
      },
    },
  );

  if (!response.ok) return [];
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/content/listArtistSongs.ts` around lines 74 - 85, The current tree fetch
hardcodes "main" which fails for repos with other default branches; update the
logic in listArtistSongs (around the fetch that assigns response) to first call
GET https://api.github.com/repos/{owner}/{repo} with the same headers, parse
default_branch from its JSON, then call the tree API using that branch (e.g.,
.../git/trees/{default_branch}?recursive=1); ensure you check response.ok for
both requests and return [] or surface an error appropriately if either request
fails, preserving existing Authorization, Accept, and User-Agent headers.
src/sandboxes/ensureOrgRepos.ts (1)

19-25: ⚠️ Potential issue | 🟠 Major

Fail fast when GITHUB_TOKEN is absent.

At Line 24, the function returns after logging, which makes this setup step appear successful to callers even though a required credential is missing.

🔧 Proposed fix
   if (!githubToken) {
     logger.error("Missing GITHUB_TOKEN for org repos");
-    return;
+    throw new Error("Missing GITHUB_TOKEN for org repo setup");
   }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/sandboxes/ensureOrgRepos.ts` around lines 19 - 25, In ensureOrgRepos, do
not silently return when the required GITHUB_TOKEN is missing; replace the
logger.error + return with a hard failure (throw an Error with a clear message,
e.g., "Missing GITHUB_TOKEN for org repos") so callers fail fast; update the
ensureOrgRepos implementation and any callers/tests to expect or handle the
thrown error accordingly.
src/sandboxes/git/pushOrgRepos.ts (1)

15-21: ⚠️ Potential issue | 🟠 Major

Return an explicit status from pushOrgRepos instead of silently no-oping.

Line 15 + Line 18-Line 21 currently hide the “skipped due to missing token” state from callers. pushSandboxToGithub continues downstream unconditionally, so partial publish flows are indistinguishable from success.

✅ Proposed fix (explicit status + caller handling)
diff --git a/src/sandboxes/git/pushOrgRepos.ts b/src/sandboxes/git/pushOrgRepos.ts
@@
-export async function pushOrgRepos(sandbox: Sandbox): Promise<void> {
+export async function pushOrgRepos(sandbox: Sandbox): Promise<boolean> {
   const githubToken = process.env.GITHUB_TOKEN;
@@
   if (!githubToken) {
-    logger.log("No GITHUB_TOKEN, skipping org submodule registration");
-    return;
+    logger.log("No GITHUB_TOKEN, skipping org repo push");
+    return false;
   }
@@
   if (orgNames.length === 0) {
-    logger.log("No org repos found, skipping submodule registration");
-    return;
+    logger.log("No org repos found, skipping org repo push");
+    return true;
   }
@@
   await runOpenClawAgent(sandbox, {
     label: "Pushing org repo changes",
     message,
   });
@@
   logger.log("Org repo push complete", {
     count: orgNames.length,
   });
+  return true;
 }
diff --git a/src/sandboxes/pushSandboxToGithub.ts b/src/sandboxes/pushSandboxToGithub.ts
@@
-  await pushOrgRepos(sandbox);
+  if (!(await pushOrgRepos(sandbox))) {
+    return false;
+  }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/sandboxes/git/pushOrgRepos.ts` around lines 15 - 21, Update pushOrgRepos
to return an explicit status instead of silently returning void: change the
signature of pushOrgRepos to return a Promise<boolean> (or a small enum) and
return false when GITHUB_TOKEN is missing or the operation is skipped and true
on successful completion; update the caller pushSandboxToGithub to check the
returned value and handle the "skipped" case (e.g., abort downstream steps or
surface an error) so callers can distinguish success from "skipped due to
missing token." Ensure references to pushOrgRepos and pushSandboxToGithub are
updated accordingly.
src/content/renderFinalVideo.ts (1)

211-215: ⚠️ Potential issue | 🟠 Major

Return type mismatch with interface.

The RenderFinalVideoOutput interface (lines 134-141) defines dataUrl as the property name, but the return statement at lines 211-215 returns videoUrl instead. This causes a type error in src/content/testPipeline.ts at line 323, where the code attempts to access result.dataUrl, which does not exist on the returned object.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/content/renderFinalVideo.ts` around lines 211 - 215, The return object
from the function currently returns videoUrl but the expected interface is
RenderFinalVideoOutput which defines dataUrl; update the return to include
dataUrl mapped to the existing videoUrl (e.g., dataUrl: videoUrl) while keeping
mimeType and sizeBytes unchanged so callers like testPipeline.ts can access
result.dataUrl; ensure the function signature and any type annotations still
align with RenderFinalVideoOutput.
🧹 Nitpick comments (27)
src/sandboxes/__tests__/copyOpenClawToRepo.test.ts (1)

9-11: Remove the empty JSDoc block.

The comment block at Line 9–Line 11 is empty and adds noise in tests; please remove it unless you plan to document behavior there.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/sandboxes/__tests__/copyOpenClawToRepo.test.ts` around lines 9 - 11,
Remove the empty JSDoc block (the standalone "/** */" comment) present near the
top of the test file; simply delete that empty comment so the test file no
longer contains the unused JSDoc noise and ensure there are no other empty JSDoc
blocks left in the same file.
src/content/transcribeSong.ts (2)

71-75: Incomplete JSDoc parameters add noise without value.

The @param tags list only parameter names without descriptions. Either provide meaningful descriptions or remove these empty annotations—the function signature already conveys the parameter names.

📝 Suggested fix: Complete or remove JSDoc params

Option 1 - Complete the documentation:

 /**
  * Gets the lyrics for a specific time range within a song.
- *
- * `@param` lyrics
- * `@param` startSeconds
- * `@param` endSeconds
+ * `@param` lyrics - The full song lyrics with timestamped segments
+ * `@param` startSeconds - Start of the time range in seconds
+ * `@param` endSeconds - End of the time range in seconds
+ * `@returns` Object containing concatenated lyrics text and matching segments
  */

Option 2 - Remove empty params:

 /**
  * Gets the lyrics for a specific time range within a song.
- *
- * `@param` lyrics
- * `@param` startSeconds
- * `@param` endSeconds
  */
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/content/transcribeSong.ts` around lines 71 - 75, The JSDoc above the
transcribeSong function contains `@param` entries with only parameter names and no
descriptions, which is noisy; either remove those empty `@param` tags or replace
them with concise descriptions for each parameter (e.g., explain lyrics,
startSeconds, endSeconds and their types/units) in the JSDoc for function
transcribeSong so the docblock is meaningful and matches the function signature.

76-84: Multiple exports violate Single Responsibility Principle.

This file exports both transcribeSong and getLyricsForTimeRange. Consider extracting getLyricsForTimeRange to a separate utility file (e.g., src/content/lyricsUtils.ts) to comply with the one-exported-function-per-file guideline.

As per coding guidelines: "Implement SRP (Single Responsibility Principle): have one exported function per file".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/content/transcribeSong.ts` around lines 76 - 84, The file currently
exports both transcribeSong and getLyricsForTimeRange; extract
getLyricsForTimeRange into its own module by creating a new file that exports
getLyricsForTimeRange (keeping its signature and returning { clipLyrics,
segments }), import any needed types (SongLyrics, LyricSegment) into that new
module, update the original file to remove the getLyricsForTimeRange export and
replace its internal references with an import of getLyricsForTimeRange from the
new module, and run/adjust any unit tests or callers to import the function from
the new module so each file only exports one main function.
src/pulse/executePulseInSandbox.ts (1)

22-27: Remove redundant auto-generated JSDoc params.

Lines 22-23 already document params.accountId and params.prompt. The root0 parameters (lines 24-26) appear to be auto-generated artifacts that duplicate this documentation and add confusion. Remove the redundant entries.

Suggested fix
 /**
  * Executes a pulse in a sandbox by calling POST /api/sandboxes with a prompt.
  * The API creates/resumes a sandbox and runs the prompt via OpenClaw.
  *
  * `@param` params.accountId - The account ID to execute the pulse for
  * `@param` params.prompt - The pulse prompt to execute
- * `@param` root0
- * `@param` root0.accountId
- * `@param` root0.prompt
  * `@returns` The sandbox ID and run ID on success, undefined on error
  */
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/pulse/executePulseInSandbox.ts` around lines 22 - 27, The JSDoc contains
redundant autogenerated param entries (root0, root0.accountId, root0.prompt)
that duplicate params.accountId and params.prompt; edit the JSDoc for
executePulseInSandbox to remove the redundant root0* param lines so only the
meaningful params (params.accountId and params.prompt) remain and the return
description stays intact.
src/content/upscaleImage.ts (1)

40-43: Complete or remove incomplete JSDoc block.

The JSDoc has an empty description and @param data without any explanation. Either provide meaningful documentation or remove the comment.

Suggested fix
-/**
- *
- * `@param` data
- */
+/** Extracts the output URL from a fal.ai response payload. */
 function extractFalUrl(data: Record<string, unknown>): string | undefined {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/content/upscaleImage.ts` around lines 40 - 43, The JSDoc above the
upscaleImage function is incomplete (empty description and a bare "@param
data"); either remove the entire JSDoc block or replace it with a concise
docstring that describes what upscaleImage does, documents the "data" parameter
(type and expected shape/properties) and the return value/promise (e.g.,
processed image buffer or response). Update the JSDoc near the upscaleImage
function to include a short one-line description, "@param data {Type} -
description" and an "@returns {Type} - description" or simply delete the /** ...
*/ block if you prefer no comment.
src/sandboxes/getSandboxEnv.ts (1)

4-6: Complete the JSDoc @param description.

The @param accountId tag is missing a description. Add a brief explanation of what the parameter represents.

Suggested fix
 /**
  * Builds the environment variables to inject into sandbox commands.
  * Shared by runSandboxCommandTask and codingAgentTask.
  *
- * `@param` accountId
+ * `@param` accountId - The account identifier to include in the environment
  */
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/sandboxes/getSandboxEnv.ts` around lines 4 - 6, Add a brief description
for the JSDoc `@param` tag for accountId in the getSandboxEnv function: explain
that accountId is the unique identifier (string or number) for the user/account
whose sandbox environment variables should be retrieved or used to load the
sandbox configuration. Update the JSDoc comment above getSandboxEnv to include
this description.
src/sandboxes/__tests__/snapshotAndPersist.test.ts (1)

15-17: Remove empty JSDoc comment block.

This JSDoc block is empty and provides no documentation value. Either add a meaningful description for createMockSandbox or remove the comment entirely.

Suggested fix
-/**
- *
- */
 function createMockSandbox() {

Or add a meaningful description:

-/**
- *
- */
+/** Creates a mock Sandbox with a stubbed snapshot method for testing. */
 function createMockSandbox() {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/sandboxes/__tests__/snapshotAndPersist.test.ts` around lines 15 - 17,
Remove the empty JSDoc block above createMockSandbox: either delete the blank
/** */ entirely or replace it with a concise meaningful description for the
createMockSandbox helper (one-line summary of purpose and behavior), ensuring
the comment directly precedes the createMockSandbox declaration.
src/content/upscaleVideo.ts (2)

46-49: Complete or remove incomplete JSDoc block.

Same issue as in upscaleImage.ts - the JSDoc has an empty description and @param data without explanation.

Suggested fix
-/**
- *
- * `@param` data
- */
+/** Extracts the output URL from a fal.ai response payload. */
 function extractFalUrl(data: Record<string, unknown>): string | undefined {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/content/upscaleVideo.ts` around lines 46 - 49, The JSDoc above the
upscaleVideo function is incomplete — either fill in a meaningful description
and document the `data` parameter (its expected type and any properties used by
upscaleVideo, e.g., input path, output path, scaleFactor, options) or remove the
empty JSDoc block entirely; update the comment immediately above the
upscaleVideo function to include a one-line summary and a proper `@param {Type}
data` description that matches the function's actual parameter shape.

50-64: Extract extractFalUrl to a shared utility module.

This helper function is duplicated identically across at least five content files (upscaleVideo.ts, upscaleImage.ts, generateContentImage.ts, generateContentVideo.ts, and generateAudioVideo.ts). Extract it to a dedicated utils module (e.g., src/content/utils/falUrlExtractor.ts) and import it in all files to follow the DRY principle.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/content/upscaleVideo.ts` around lines 50 - 64, Extract the duplicated
function extractFalUrl into a single exported helper module (create and export a
function named extractFalUrl in a new utils module), update each file that
currently defines it (upscaleVideo.ts, upscaleImage.ts, generateContentImage.ts,
generateContentVideo.ts, generateAudioVideo.ts) to remove the local
implementation and import { extractFalUrl } from the new module, and ensure the
imported function signature and behavior remain unchanged so calls to
extractFalUrl(data: Record<string, unknown>) continue to work as before.
src/sandboxes/__tests__/syncOrgRepos.test.ts (1)

10-12: Remove empty JSDoc comment block.

This empty JSDoc block adds no documentation value. Either add a meaningful description for createMockSandbox or remove the comment entirely.

📝 Suggested options

Option 1: Remove empty comment

-/**
- *
- */
 function createMockSandbox() {

Option 2: Add meaningful description

-/**
- *
- */
+/** Creates a mock sandbox with a stubbed runCommand method for testing. */
 function createMockSandbox() {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/sandboxes/__tests__/syncOrgRepos.test.ts` around lines 10 - 12, Remove
the empty JSDoc block at the top of the test file (the blank /** */) — either
delete it entirely or replace it with a short meaningful description for the
createMockSandbox helper (referencing createMockSandbox) so the file no longer
contains a useless empty JSDoc comment; update the comment to describe the
helper’s purpose if you choose to keep it.
src/content/fetchArtistContext.ts (1)

4-7: Consider adding parameter descriptions to JSDoc.

The parameter annotations lack descriptions. Adding brief descriptions would improve documentation clarity.

📝 Suggested improvement
 *
-* `@param` githubRepo
-* `@param` artistSlug
-* `@param` fetchFile
+* `@param` githubRepo - GitHub repository URL
+* `@param` artistSlug - Artist directory identifier
+* `@param` fetchFile - Function to fetch file content from the repository
 */
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/content/fetchArtistContext.ts` around lines 4 - 7, Update the JSDoc for
the fetchArtistContext function by adding brief descriptions for each `@param`:
describe githubRepo (e.g., the GitHub repository identifier or client used),
artistSlug (the artist's unique slug used to locate their content), and
fetchFile (the helper/function used to fetch files or a flag indicating file
retrieval behavior), and also ensure the return/throws tags (if present) are
meaningful; modify the JSDoc block immediately above fetchArtistContext to
include these parameter descriptions.
src/content/listArtistSongs.ts (2)

7-8: JSDoc parameter annotations are incomplete.

The JSDoc @param tags lack descriptions. Either add meaningful descriptions or remove the empty parameter annotations to avoid documentation noise.

 * `@param` githubRepoUrl
 * `@param` artistSlug

Could be:

-* `@param` githubRepoUrl
-* `@param` artistSlug
+* `@param` githubRepoUrl - The GitHub repository URL to search
+* `@param` artistSlug - The artist's slug identifier for folder lookup

Also applies to: 45-47

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/content/listArtistSongs.ts` around lines 7 - 8, The JSDoc for the
function listArtistSongs (and other JSDoc blocks around lines 45-47) contains
`@param` tags with empty descriptions (e.g., `@param` githubRepoUrl, `@param`
artistSlug); update these JSDoc comments by adding concise descriptions for each
parameter (what they represent and expected type/format) or remove the empty
`@param` lines entirely so the documentation is not noisy—look for the JSDoc block
above the listArtistSongs function and any subsequent blocks at the indicated
region and either fill in meaningful descriptions for githubRepoUrl and
artistSlug (and any other empty params) or delete those `@param` annotations.

11-14: Multiple exported functions violate SRP guideline.

This file exports both listArtistSongs and parseSongPath. As per coding guidelines, files should have "one exported function per file."

Consider extracting parseSongPath to a separate file (e.g., src/content/parseSongPath.ts) since it's used by consumers to decode the encoded paths.

Also applies to: 48-57

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/content/listArtistSongs.ts` around lines 11 - 14, This file currently
exports both listArtistSongs and parseSongPath which breaks the
one-export-per-file rule; extract parseSongPath into its own module (e.g.,
create src/content/parseSongPath.ts) and export it from there, remove its export
from src/content/listArtistSongs.ts so only listArtistSongs remains exported,
and update any call sites/imports to import parseSongPath from the new module;
ensure function signature and runtime behavior of parseSongPath remain unchanged
and run tests to verify no import paths are broken.
src/sandboxes/__tests__/setupOpenClaw.test.ts (1)

13-15: Remove empty JSDoc comment.

The empty JSDoc block adds no value. Either remove it or add a meaningful description for createMockSandbox.

Suggested fix
-/**
- *
- */
 function createMockSandbox() {

Or add a proper description:

-/**
- *
- */
+/** Creates a mock Sandbox with stubbed runCommand method. */
 function createMockSandbox() {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/sandboxes/__tests__/setupOpenClaw.test.ts` around lines 13 - 15, Remove
the empty JSDoc block above createMockSandbox in the test file; either delete
the blank /** */ entirely or replace it with a concise JSDoc describing the
createMockSandbox helper (e.g., its purpose and return value) so the comment is
meaningful and not an empty block.
src/recoup/scrapeSocial.ts (1)

17-19: Incomplete JSDoc @param tag.

The @param socialId is missing a description. Either complete it or remove the tag to avoid inconsistency with the rest of the documentation.

Suggested fix
 * Returns Apify run metadata that can be used to poll for status and retrieve results.
 *
- * `@param` socialId
+ * `@param` socialId - The social profile ID to scrape
 */
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/recoup/scrapeSocial.ts` around lines 17 - 19, The JSDoc for the function
handling social scraping contains an incomplete `@param socialId` tag; update
the JSDoc for the function (e.g., the scrapeSocial or equivalent function that
takes socialId) to either remove the orphan `@param` or add a concise
description like "socialId - the ID or handle of the social account to scrape"
so the param documentation is consistent and informative; locate the JSDoc block
above the function that references socialId and edit the `@param` line
accordingly.
src/github/getExistingGithubRepo.ts (1)

40-40: Consider using Zod for response validation.

The response is cast with a type assertion rather than validated. If the GitHub API response shape changes or returns an error object, this could lead to runtime issues when accessing html_url.

Suggested fix using Zod
+import { z } from "zod";
+
+const repoResponseSchema = z.object({
+  html_url: z.string(),
+});
+
 // In the function:
-    const data = (await response.json()) as { html_url: string };
+    const json = await response.json();
+    const result = repoResponseSchema.safeParse(json);
+
+    if (!result.success) {
+      logger.error("Invalid response from GitHub API", {
+        repoName,
+        errors: result.error.issues,
+      });
+      return undefined;
+    }
+
+    const data = result.data;

As per coding guidelines: "Use Zod for schema validation" applies to src/**/*.{ts,tsx} files.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/github/getExistingGithubRepo.ts` at line 40, The code casts the GitHub
response with a type assertion (const data = (await response.json()) as {
html_url: string }) which risks runtime errors; replace this with Zod
validation: import z from "zod", define a schema like repoSchema = z.object({
html_url: z.string().url() }), parse the JSON via repoSchema.parse(await
response.json()) or use safeParse and handle failures, then use the parsed
object's html_url; update any error handling in getExistingGithubRepo to
log/throw on validation failure instead of assuming the shape.
src/sandboxes/__tests__/addOrgSubmodules.test.ts (1)

13-15: Remove empty JSDoc block.

The JSDoc comment on the createMockSandbox helper is completely empty and adds no documentation value.

🧹 Suggested fix
-/**
- *
- */
 function createMockSandbox() {

Or add a meaningful description:

-/**
- *
- */
+/** Creates a mock sandbox with a stubbed runCommand method. */
 function createMockSandbox() {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/sandboxes/__tests__/addOrgSubmodules.test.ts` around lines 13 - 15,
Remove the empty JSDoc block above the createMockSandbox helper in the test
file: delete the /** */ block entirely (or replace it with a concise meaningful
description of what createMockSandbox does), ensuring the createMockSandbox
declaration is left directly preceded by either no comment or a short
descriptive JSDoc comment.
src/content/fetchAudienceContext.ts (1)

4-7: Consider adding descriptions to JSDoc @param annotations.

The added @param annotations are empty and don't provide additional documentation value. Either add meaningful descriptions or remove them to avoid documentation noise.

📝 Suggested improvement
 /**
  * Fetches audience context (audience.md) from GitHub.
  * Returns placeholder if not found.
- *
- * `@param` githubRepo
- * `@param` artistSlug
- * `@param` fetchFile
+ * `@param` githubRepo - The GitHub repository URL
+ * `@param` artistSlug - The artist identifier/slug
+ * `@param` fetchFile - Function to fetch file content from repo
  */
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/content/fetchAudienceContext.ts` around lines 4 - 7, The JSDoc for
fetchAudienceContext currently lists `@param` githubRepo, `@param` artistSlug, and
`@param` fetchFile with no descriptions; update the JSDoc above the
fetchAudienceContext function in src/content/fetchAudienceContext.ts to either
remove those empty `@param` tags or replace them with short, meaningful
descriptions explaining each parameter's purpose (e.g., what type/value
githubRepo expects, what artistSlug represents, and what fetchFile does), and
add a brief `@returns` description if applicable.
src/content/fetchGithubFile.ts (1)

96-99: Empty JSDoc block adds no value.

The JSDoc for parseRepoUrl contains only an empty description and a parameter name without explanation. Either add meaningful documentation or remove the block entirely.

📝 Suggested improvement
-/**
- *
- * `@param` githubRepoUrl
- */
+/** Extracts owner and repo name from a GitHub URL. */
 function parseRepoUrl(githubRepoUrl: string): { owner: string; repo: string } {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/content/fetchGithubFile.ts` around lines 96 - 99, The JSDoc above
parseRepoUrl is empty and adds no value; remove the empty block or replace it
with a concise description and parameter explanation (e.g., describe what
parseRepoUrl does, the expected format of githubRepoUrl, and the return value).
Update the JSDoc for parseRepoUrl to include meaningful text for the
githubRepoUrl param and the function's return type/behavior, or delete the /**
... */ block entirely if you prefer no doc comment.
src/recoup/fetchTask.ts (1)

30-32: Add a short description to @param externalId.

The tag is present but currently not descriptive.

📝 Suggested doc tweak
- * `@param` externalId
+ * `@param` externalId - External task ID used to fetch the task from the Recoup Tasks API.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/recoup/fetchTask.ts` around lines 30 - 32, Add a one-line description for
the JSDoc `@param` externalId in the fetchTask function: describe that externalId
is the external system identifier (e.g., third-party or upstream task ID) used
to locate or fetch the task, so update the comment above fetchTask to read a
short phrase like "externalId - external system/task identifier used to fetch
the task."
src/sandboxes/__tests__/runOpenClawAgent.test.ts (1)

15-21: Trim or complete the new JSDoc blocks.

These docblocks are currently empty/low-signal. Either add meaningful descriptions or remove them to keep test helpers concise.

✂️ Suggested cleanup
-/**
- *
- * `@param` finished
- * `@param` finished.exitCode
- * `@param` finished.stdout
- * `@param` finished.stderr
- */
 function mockDetachedCommand(finished: {
   exitCode: number;
   stdout: () => Promise<string>;
   stderr: () => Promise<string>;
 }) {
   return { wait: vi.fn().mockResolvedValue(finished) };
 }
 
-/**
- *
- */
 function createMockSandbox() {
   const runCommand = vi.fn();
   return { runCommand } as any;
 }

Also applies to: 30-32

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/sandboxes/__tests__/runOpenClawAgent.test.ts` around lines 15 - 21, The
JSDoc block for the test helper parameter "finished" is empty/low-signal—either
remove the docblock entirely or replace it with concise descriptions for the
parameter and its properties (finished.exitCode, finished.stdout,
finished.stderr); update the JSDoc above the helper function used in
runOpenClawAgent.test.ts (the function that accepts the "finished" param) to
include a one-line summary and short `@param` lines describing each property, or
delete the entire block to keep the test helper concise.
src/content/generateAudioVideo.ts (1)

88-94: JSDoc @param tags lack descriptions.

The @param annotations are present but empty, which doesn't add value. Either add meaningful descriptions or remove the empty tags.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/content/generateAudioVideo.ts` around lines 88 - 94, Update the JSDoc for
the clip function in src/content/generateAudioVideo.ts by either removing the
empty `@param` tags or, preferably, adding concise descriptions for each parameter
used by the function (songBuffer, startSeconds, durationSeconds) and any return
value; for example document that songBuffer is the MP3 file buffer, startSeconds
is the clip start time in seconds, and durationSeconds is the clip length in
seconds so the JSDoc on the function (the block above the clip/clipSong or
generateAudioVideo function) provides meaningful parameter documentation.
src/recoup/getArtistSocials.ts (1)

34-37: Empty JSDoc @param tag.

Same pattern as other files — the @param annotation lacks a description.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/recoup/getArtistSocials.ts` around lines 34 - 37, The JSDoc for
getArtistSocials has an empty `@param` tag; update the comment above the
getArtistSocials function to provide a clear description for the artistAccountId
parameter (e.g., "artistAccountId - the unique identifier or account ID of the
artist whose social links are being retrieved") so the `@param` is not blank and
matches the style used in other files.
src/content/loadTemplate.ts (1)

26-27: Empty JSDoc @param tags don't add documentation value.

Multiple functions have @param paramName annotations without descriptions. Either add meaningful descriptions or remove the empty tags to avoid clutter.

Also applies to: 81-82, 93-95, 128-129, 145-149

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/content/loadTemplate.ts` around lines 26 - 27, Remove or fill empty JSDoc
`@param` tags in this file: update the JSDoc blocks for loadTemplate and the other
documented functions (e.g., getTemplate, compileTemplate, renderTemplate) so
each `@param` either has a concise description or is removed entirely; ensure the
remaining JSDoc tags accurately describe parameter names shown in the
corresponding function signatures (match symbol names loadTemplate, getTemplate,
compileTemplate, renderTemplate) and keep the comments minimal and relevant.
src/content/testPipeline.ts (1)

50-58: Empty JSDoc blocks throughout the file add no documentation value.

Multiple functions have JSDoc blocks with no content (e.g., loadState, saveState, setupFal, testImage, etc.). These empty comment blocks clutter the code without providing documentation. Either add meaningful descriptions or remove them.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/content/testPipeline.ts` around lines 50 - 58, Remove or populate the
empty JSDoc blocks that provide no value: locate the empty /** */ comments above
functions like loadState, saveState, setupFal, testImage, etc., and either
delete those empty JSDoc blocks or replace them with brief meaningful
descriptions and param/return tags where appropriate (e.g., describe what
loadState returns and what saveState persists). Ensure any added JSDoc
accurately references the function signature (parameters and return types) and
keep comments concise.
src/socials/filterScrapableSocials.ts (1)

15-17: Empty JSDoc parameter descriptions provide no value.

The @param annotations lack descriptions. Either add meaningful documentation or remove the empty annotations to reduce noise.

 * Filters and collects all scrapable socials from the artist socials map.
 * Returns an array of scrapable socials with their associated artist IDs.
- *
- * `@param` artistIds
- * `@param` artistSocialsMap
 */
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/socials/filterScrapableSocials.ts` around lines 15 - 17, The JSDoc for
filterScrapableSocials contains empty `@param` tags for artistIds and
artistSocialsMap which are noisy; update the JSDoc by either removing those
empty `@param` annotations or replacing them with brief, meaningful descriptions
(e.g., describe that artistIds is an array of artist identifiers and
artistSocialsMap is a map/object of social links keyed by artist ID) so the
function header documents its inputs clearly.
src/socials/scrapeAndPollSocials.ts (1)

12-14: Empty JSDoc parameter descriptions.

Same issue as other files—@param tags without descriptions add clutter without value.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/socials/scrapeAndPollSocials.ts` around lines 12 - 14, The JSDoc for the
scrapeAndPollSocials function contains empty `@param` tags that add noise; either
remove the empty `@param` entries or replace them with concise descriptions for
the parameters (e.g., describe "socials" and "batchSize") in the JSDoc block for
the scrapeAndPollSocials function so the comment is meaningful and consistent
with other files.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 522fe480-bf83-4718-a85f-5599fc8a9165

📥 Commits

Reviewing files that changed from the base of the PR and between 70f345c and 0576ed5.

📒 Files selected for processing (98)
  • src/artists/getBatchArtistSocials.ts
  • src/artists/isScrapableSocial.ts
  • src/chats/getTaskRoomId.ts
  • src/consts.ts
  • src/content/analyzeClips.ts
  • src/content/defaultPipelineConfig.ts
  • src/content/fetchArtistContext.ts
  • src/content/fetchAudienceContext.ts
  • src/content/fetchGithubFile.ts
  • src/content/generateAudioVideo.ts
  • src/content/generateCaption.ts
  • src/content/generateContentImage.ts
  • src/content/generateContentVideo.ts
  • src/content/listArtistSongs.ts
  • src/content/loadTemplate.ts
  • src/content/renderFinalVideo.ts
  • src/content/selectAudioClip.ts
  • src/content/testPipeline.ts
  • src/content/transcribeSong.ts
  • src/content/upscaleImage.ts
  • src/content/upscaleVideo.ts
  • src/github/__tests__/createOrgGithubRepo.test.ts
  • src/github/createGithubRepo.ts
  • src/github/createOrgGithubRepo.ts
  • src/github/getExistingGithubRepo.ts
  • src/polling/pollScraperResults.ts
  • src/pulse/__tests__/executePulseInSandbox.test.ts
  • src/pulse/executePulseInSandbox.ts
  • src/recoup/__tests__/getAccountOrgs.test.ts
  • src/recoup/createAccountSandbox.ts
  • src/recoup/createChat.ts
  • src/recoup/fetchActivePulses.ts
  • src/recoup/fetchTask.ts
  • src/recoup/generateChat.ts
  • src/recoup/getAccount.ts
  • src/recoup/getAccountOrgs.ts
  • src/recoup/getAccountSandboxes.ts
  • src/recoup/getArtistSocials.ts
  • src/recoup/getProArtists.ts
  • src/recoup/getScraperResults.ts
  • src/recoup/scrapeSocial.ts
  • src/recoup/updateAccountSnapshot.ts
  • src/sandboxes/__tests__/addOrgSubmodules.test.ts
  • src/sandboxes/__tests__/cloneMonorepoViaAgent.test.ts
  • src/sandboxes/__tests__/configureGitAuth.test.ts
  • src/sandboxes/__tests__/copyOpenClawToRepo.test.ts
  • src/sandboxes/__tests__/ensureOrgRepos.test.ts
  • src/sandboxes/__tests__/getGitHubAuthPrefix.test.ts
  • src/sandboxes/__tests__/getOrCreateSandbox.test.ts
  • src/sandboxes/__tests__/getSandboxHomeDir.test.ts
  • src/sandboxes/__tests__/notifyCodingAgentCallback.test.ts
  • src/sandboxes/__tests__/pushOrgRepos.test.ts
  • src/sandboxes/__tests__/runClaudeCodeAgent.test.ts
  • src/sandboxes/__tests__/runOpenClawAgent.test.ts
  • src/sandboxes/__tests__/setupOpenClaw.test.ts
  • src/sandboxes/__tests__/snapshotAndPersist.test.ts
  • src/sandboxes/__tests__/stripGitmodulesTokens.test.ts
  • src/sandboxes/__tests__/syncOrgRepos.test.ts
  • src/sandboxes/cloneMonorepoViaAgent.ts
  • src/sandboxes/configureGitAuth.ts
  • src/sandboxes/ensureGithubRepo.ts
  • src/sandboxes/ensureOrgRepos.ts
  • src/sandboxes/ensureSetupSandbox.ts
  • src/sandboxes/getOrCreateSandbox.ts
  • src/sandboxes/getSandboxEnv.ts
  • src/sandboxes/getVercelSandboxCredentials.ts
  • src/sandboxes/git/addOrgSubmodules.ts
  • src/sandboxes/git/pushOrgRepos.ts
  • src/sandboxes/installSkill.ts
  • src/sandboxes/logStep.ts
  • src/sandboxes/notifyCodingAgentCallback.ts
  • src/sandboxes/onboardOpenClaw.ts
  • src/sandboxes/parsePRUrls.ts
  • src/sandboxes/pushSandboxToGithub.ts
  • src/sandboxes/runGitCommand.ts
  • src/sandboxes/runOpenClawAgent.ts
  • src/sandboxes/runSetupArtistSkill.ts
  • src/sandboxes/runSetupSandboxSkill.ts
  • src/sandboxes/setupOpenClaw.ts
  • src/sandboxes/snapshotAndPersist.ts
  • src/sandboxes/writeReadme.ts
  • src/schemas/__tests__/contentCreationSchema.test.ts
  • src/schemas/contentCreationSchema.ts
  • src/schemas/sandboxSchema.ts
  • src/socials/filterScrapableSocials.ts
  • src/socials/scrapeAndPollSocials.ts
  • src/tasks/__tests__/codingAgentTask.test.ts
  • src/tasks/__tests__/sendPulsesTask.test.ts
  • src/tasks/__tests__/setupSandboxTask.test.ts
  • src/tasks/__tests__/updatePRTask.test.ts
  • src/tasks/codingAgentTask.ts
  • src/tasks/createContentTask.ts
  • src/tasks/customerPromptTask.ts
  • src/tasks/proArtistSocialProfilesScrape.ts
  • src/tasks/runSandboxCommandTask.ts
  • src/tasks/sendPulsesTask.ts
  • src/tasks/setupSandboxTask.ts
  • src/tasks/updatePRTask.ts
💤 Files with no reviewable changes (3)
  • src/schemas/tests/contentCreationSchema.test.ts
  • src/schemas/contentCreationSchema.ts
  • src/sandboxes/tests/cloneMonorepoViaAgent.test.ts

Comment on lines +19 to +28
* @param imageUrl.imageUrl
* @param imageUrl - URL of the AI-generated image
* @param songBuffer - Raw mp3 bytes of the song
* @param audioStartSeconds - Where to clip the song from
* @param audioDurationSeconds - How long the clip should be
* @param motionPrompt - Describes how the subject should move
* @param imageUrl.songBuffer
* @param imageUrl.audioStartSeconds
* @param imageUrl.audioDurationSeconds
* @param imageUrl.motionPrompt
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Malformed JSDoc @param annotations.

The JSDoc parameter annotations are incorrectly formatted. They reference imageUrl.imageUrl, imageUrl.songBuffer, etc., but the function uses destructured parameters at the top level (imageUrl, songBuffer, audioStartSeconds, etc.). This appears to be auto-generated documentation that didn't correctly parse the parameter structure.

📝 Proposed fix for JSDoc
 * Matches the content-creation-app's generateAudioVideo.ts behavior.
 *
- * `@param` imageUrl.imageUrl
  * `@param` imageUrl - URL of the AI-generated image
  * `@param` songBuffer - Raw mp3 bytes of the song
  * `@param` audioStartSeconds - Where to clip the song from
  * `@param` audioDurationSeconds - How long the clip should be
  * `@param` motionPrompt - Describes how the subject should move
- * `@param` imageUrl.songBuffer
- * `@param` imageUrl.audioStartSeconds
- * `@param` imageUrl.audioDurationSeconds
- * `@param` imageUrl.motionPrompt
  * `@returns` URL of the generated video (with audio baked in)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/content/generateAudioVideo.ts` around lines 19 - 28, The JSDoc `@param`
lines are malformed (e.g., "imageUrl.imageUrl", "imageUrl.songBuffer") and must
match the actual function parameters; update the JSDoc for the function
(generateAudioVideo or the top-level exported function in
src/content/generateAudioVideo.ts) to use correct `@param` names: imageUrl,
songBuffer, audioStartSeconds, audioDurationSeconds, motionPrompt, and provide
short descriptions for each, removing any "imageUrl." prefixes so the
annotations align with the destructured parameters used in the implementation.

Comment on lines +19 to +27
*
* @param root0
* @param root0.template
* @param root0.songTitle
* @param root0.fullLyrics
* @param root0.clipLyrics
* @param root0.artistContext
* @param root0.audienceContext
* @param root0.captionLength
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Auto-generated JSDoc parameter names are not meaningful.

The root0, root0.template, etc. parameter names appear to be auto-generated placeholders and don't provide useful documentation. Consider either removing them or replacing with meaningful descriptions.

📝 Suggested improvement
 * Matches the content-creation-app's generateCaption.ts behavior.
 *
- * `@param` root0
- * `@param` root0.template
- * `@param` root0.songTitle
- * `@param` root0.fullLyrics
- * `@param` root0.clipLyrics
- * `@param` root0.artistContext
- * `@param` root0.audienceContext
- * `@param` root0.captionLength
+ * `@param` options - Caption generation options
+ * `@param` options.template - Template data with style/caption guides
+ * `@param` options.songTitle - Title of the song
+ * `@param` options.fullLyrics - Complete song lyrics
+ * `@param` options.clipLyrics - Lyrics for the selected clip window
+ * `@param` options.artistContext - Context about the artist
+ * `@param` options.audienceContext - Context about the target audience
+ * `@param` options.captionLength - Desired caption length (short/medium/long)
 */
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
*
* @param root0
* @param root0.template
* @param root0.songTitle
* @param root0.fullLyrics
* @param root0.clipLyrics
* @param root0.artistContext
* @param root0.audienceContext
* @param root0.captionLength
*
* `@param` options - Caption generation options
* `@param` options.template - Template data with style/caption guides
* `@param` options.songTitle - Title of the song
* `@param` options.fullLyrics - Complete song lyrics
* `@param` options.clipLyrics - Lyrics for the selected clip window
* `@param` options.artistContext - Context about the artist
* `@param` options.audienceContext - Context about the target audience
* `@param` options.captionLength - Desired caption length (short/medium/long)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/content/generateCaption.ts` around lines 19 - 27, The JSDoc block above
generateCaption contains auto-generated param names like root0 and
root0.template; update the comment to use the actual parameter names (template,
songTitle, fullLyrics, clipLyrics, artistContext, audienceContext,
captionLength) and provide brief meaningful descriptions for each (or remove any
unused params), ensuring the JSDoc tags match the function signature in
generateCaption so IDEs and docs show correct parameter info.

Comment on lines +16 to +21
* @param faceGuideUrl.faceGuideUrl
* @param faceGuideUrl - fal storage URL of the artist's face-guide (headshot)
* @param referenceImagePath - local path to a template reference image (or null)
* @param prompt - Scene/style prompt that instructs the face swap
* @param faceGuideUrl.referenceImagePath
* @param faceGuideUrl.prompt
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Malformed JSDoc @param annotations.

Same pattern as other files — faceGuideUrl.faceGuideUrl, faceGuideUrl.referenceImagePath, etc. are incorrectly formatted.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/content/generateContentImage.ts` around lines 16 - 21, The JSDoc `@param`
annotations in generateContentImage.ts are malformed (e.g., entries like
"faceGuideUrl.faceGuideUrl" and duplicated fields); update the JSDoc for the
function that accepts parameters faceGuideUrl, referenceImagePath, and prompt so
each `@param` line uses the simple parameter name and a short description (for
example "@param faceGuideUrl - fal storage URL of the artist's face-guide
(headshot)", "@param referenceImagePath - local path to a template reference
image or null", "@param prompt - scene/style prompt that instructs the face
swap"), remove the incorrect dotted entries (faceGuideUrl.faceGuideUrl,
faceGuideUrl.referenceImagePath, faceGuideUrl.prompt) and ensure the remaining
`@param` names exactly match the function signature.

Comment on lines +8 to +11
* @param imageUrl.imageUrl
* @param imageUrl - URL of the source image (from generateContentImage)
* @param motionPrompt - Describes how the subject should move
* @param imageUrl.motionPrompt
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Malformed JSDoc @param annotations.

Same issue as in generateAudioVideo.ts — the annotations incorrectly reference imageUrl.imageUrl and imageUrl.motionPrompt instead of documenting the actual destructured parameters.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/content/generateContentVideo.ts` around lines 8 - 11, Fix the malformed
JSDoc for the generateContentVideo function: replace the incorrect annotations
like `@param imageUrl.imageUrl` and `@param imageUrl.motionPrompt` with proper
param entries that match the actual destructured parameters (e.g., `@param
imageUrl - URL of the source image (from generateContentImage)` and `@param
motionPrompt - Describes how the subject should move`), remove any
duplicate/misnamed lines, and ensure the JSDoc matches the function signature
used in generateContentVideo.

Comment on lines +235 to +246
* @param root0
* @param root0.videoPath
* @param root0.audioPath
* @param root0.captionLayout
* @param root0.captionLayout.lines
* @param root0.captionLayout.fontSize
* @param root0.captionLayout.lineHeight
* @param root0.captionLayout.position
* @param root0.outputPath
* @param root0.audioStartSeconds
* @param root0.audioDurationSeconds
* @param root0.hasAudio
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Auto-generated JSDoc with root0 placeholders.

The root0, root0.videoPath, etc. parameter names are auto-generated and don't provide meaningful documentation.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/content/renderFinalVideo.ts` around lines 235 - 246, The JSDoc uses
auto-generated placeholders like `root0` and `root0.videoPath`; update the
comment for the renderFinalVideo function (the destructured params: videoPath,
audioPath, captionLayout, captionLayout.lines, captionLayout.fontSize,
captionLayout.lineHeight, captionLayout.position, outputPath, audioStartSeconds,
audioDurationSeconds, hasAudio) to use those real parameter names and concise
descriptions instead of `root0` placeholders so the documentation is meaningful
and maps to the actual function signature.

Comment on lines +40 to +47
* @param githubRepo.githubRepo
* @param githubRepo - GitHub repo URL
* @param artistSlug - Artist directory name
* @param clipDuration - How long the clip should be (seconds)
* @param lipsync - Whether to prefer clips with lyrics (for lipsync mode)
* @param githubRepo.artistSlug
* @param githubRepo.clipDuration
* @param githubRepo.lipsync
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Malformed JSDoc parameter annotations.

The parameter documentation is incorrectly structured. artistSlug, clipDuration, and lipsync are top-level destructured parameters, not nested properties of githubRepo. Also, @param githubRepo.githubRepo on line 40 is redundant/invalid.

📝 Proposed fix for JSDoc
-* `@param` githubRepo.githubRepo
 * `@param` githubRepo - GitHub repo URL
 * `@param` artistSlug - Artist directory name
 * `@param` clipDuration - How long the clip should be (seconds)
 * `@param` lipsync - Whether to prefer clips with lyrics (for lipsync mode)
-* `@param` githubRepo.artistSlug
-* `@param` githubRepo.clipDuration
-* `@param` githubRepo.lipsync
 * `@returns` Selected audio clip with all metadata
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/content/selectAudioClip.ts` around lines 40 - 47, The JSDoc for
selectAudioClip has malformed param annotations: remove the redundant "@param
githubRepo.githubRepo" and update the annotations so that githubRepo is
documented as its own param and artistSlug, clipDuration, and lipsync are
documented as top‑level params (not properties of githubRepo); locate the
selectAudioClip function and fix the JSDoc `@param` entries to list `@param`
githubRepo, `@param` artistSlug, `@param` clipDuration, and `@param` lipsync with
correct types and brief descriptions.

Comment on lines +18 to +19
*
* @param runs
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Complete the JSDoc documentation.

The newly added JSDoc parameter annotation is missing a description for the runs parameter and lacks a @returns tag to document the return value.

📝 Proposed fix for complete JSDoc
 /**
  * Polls each scraper run in parallel until all are completed (SUCCEEDED or FAILED).
  * Returns an array of results for each run.
  *
- * `@param` runs
+ * `@param` runs - Array of scraper runs to poll for completion
+ * `@returns` Promise resolving to array of poll results with status and optional data
  */
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
*
* @param runs
/**
* Polls each scraper run in parallel until all are completed (SUCCEEDED or FAILED).
* Returns an array of results for each run.
*
* `@param` runs - Array of scraper runs to poll for completion
* `@returns` Promise resolving to array of poll results with status and optional data
*/
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/polling/pollScraperResults.ts` around lines 18 - 19, Update the JSDoc for
the pollScraperResults function: add a clear description for the `@param` runs
explaining what each run object contains and how it is used by
pollScraperResults (e.g., array of scraper run results to poll/aggregate), and
add an `@returns` tag that documents the function's return value (type and
meaning, e.g., Promise<SomeType> or array of processed results and what fields
it contains). Locate the function pollScraperResults in
src/polling/pollScraperResults.ts and ensure the `@param` and `@returns`
descriptions match the actual parameter and return types used in the
implementation.

export async function pollScraperResults(
runs: ScrapeRun[]
): Promise<PollResult[]> {
export async function pollScraperResults(runs: ScrapeRun[]): Promise<PollResult[]> {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

Add Zod schema validation for the input parameter.

The function accepts external input without validation. Input validation should be performed using Zod to ensure type safety at runtime.

🛡️ Proposed implementation with Zod validation

First, define the schema at the top of the file:

import { z } from "zod";

const ScrapeRunSchema = z.object({
  runId: z.string(),
  datasetId: z.string(),
});

const ScrapeRunsSchema = z.array(ScrapeRunSchema);

Then validate the input:

 export async function pollScraperResults(runs: ScrapeRun[]): Promise<PollResult[]> {
+  const validatedRuns = ScrapeRunsSchema.parse(runs);
   const results: PollResult[] = [];
-  const pendingRuns = new Map<string, ScrapeRun>(runs.map(run => [run.runId, run]));
+  const pendingRuns = new Map<string, ScrapeRun>(validatedRuns.map(run => [run.runId, run]));

As per coding guidelines: Use Zod for schema validation.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/polling/pollScraperResults.ts` at line 21, The pollScraperResults
function accepts external input without runtime validation; add Zod validation
by importing z from "zod", define ScrapeRunSchema (with runId: z.string(),
datasetId: z.string()) and ScrapeRunsSchema = z.array(ScrapeRunSchema), then at
the start of pollScraperResults validate the runs parameter using
ScrapeRunsSchema.parse or safeParse and handle failures (throwing an error or
returning a rejected Promise) so only validated data is processed; reference the
symbols ScrapeRunSchema, ScrapeRunsSchema and the function pollScraperResults
when applying the change.

Comment on lines +11 to +13
/**
*
*/
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Empty JSDoc block should be completed or removed.

The JSDoc comment is empty and provides no value. Either add meaningful documentation describing the function's purpose, or remove the empty block entirely.

📝 Suggested fix: Add documentation
 /**
- *
+ * Fetches the list of pro artist IDs from the Recoup API.
+ *
+ * `@returns` Array of pro artist IDs, or undefined on error
  */
 export async function getProArtists(): Promise<string[] | undefined> {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/**
*
*/
/**
* Fetches the list of pro artist IDs from the Recoup API.
*
* `@returns` Array of pro artist IDs, or undefined on error
*/
export async function getProArtists(): Promise<string[] | undefined> {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/recoup/getProArtists.ts` around lines 11 - 13, The empty JSDoc block
above the getProArtists function should be removed or replaced with a meaningful
comment; either delete the blank /** */ or add a concise JSDoc for getProArtists
that describes the function's purpose, its parameters (if any), return value,
and any thrown errors or side effects so readers can understand getProArtists at
a glance.

Comment on lines +13 to 14
export async function installSkill(sandbox: Sandbox, skill: string): Promise<void> {
const skillName = skill.split("/").pop()!;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Validate skillName before using it in shell command construction.

skillName (derived from skill) is later interpolated into sh -c at Line 41. Without validation, crafted input can break command boundaries.

🔒 Proposed fix
 export async function installSkill(sandbox: Sandbox, skill: string): Promise<void> {
-  const skillName = skill.split("/").pop()!;
+  const skillName = skill.split("/").pop();
+  if (!skillName || !/^[a-zA-Z0-9._-]+$/.test(skillName)) {
+    throw new Error(`Invalid skill name: ${skill}`);
+  }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/sandboxes/installSkill.ts` around lines 13 - 14, installSkill currently
derives skillName from the input string and later interpolates it into a shell
command (see sh -c usage); validate skillName before using it by ensuring it is
non-empty and contains only allowed characters (e.g., alphanumerics,
dashes/underscores) and reject or sanitize any input containing path separators
or shell metacharacters, or alternatively avoid shell interpolation by invoking
commands with argument vectors (use spawn/execFile instead of sh -c). Update the
installSkill function to perform this validation/sanitization on skillName and
switch to a safe exec method or error out when validation fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant